package org.alfresco.dbencrypt;

import org.apache.commons.dbcp.BasicDataSource;

/**
 * 
 * @author rjmfernandes@gmail.com
 * 
 */
public class SimpleEncryptPwdDataSource extends BasicDataSource {

	@Override
	public void setPassword(String password) {
		String decryptedPwd;

		try {
			decryptedPwd = SimpleEncryptor.decrypt(password);
		} catch (Exception e) {
			throw new RuntimeException(e);
		}

		super.setPassword(decryptedPwd);
	}
}
